/* enum */
import { ComponentNameEnum } from '@src/component/business/BizChatPanel/chat/model/enum'
/* scss */
import '@src/component/business/BizChatPanel/chat/components/history-message-tip/index.scss'
/* vue */
import { defineComponent } from 'vue'

export type ChatAIHistoryMessageTipProps = {
  
}

export interface ChatAIHistoryMessageTipSetupState {
  
}

export enum ChatAIHistoryMessageTipEventEnum {
  Input = 'input',
  Click = 'click'
}

export default defineComponent({
  name: ComponentNameEnum.ChatAIHistoryMessageTip,
  emits: [
    ChatAIHistoryMessageTipEventEnum.Input,
    ChatAIHistoryMessageTipEventEnum.Click,
  ],
  props: {
    isDone: {
      type: Boolean,
      default: false,
    }
  },
  setup(props: ChatAIHistoryMessageTipProps, { slots, emit }) {
    
  },
  computed: {
    text(): string {
      return this.isDone ? '收起历史会话' : '加载更多历史对话'
    }
  },
  methods: {
    onInputHandler(value: string) {
      this.$emit(ChatAIHistoryMessageTipEventEnum.Input, value)
    },
    onClickHandler() {
      this.$emit(ChatAIHistoryMessageTipEventEnum.Click)
    }
  },
  render() {
    return (
      <div 
        class={ComponentNameEnum.ChatAIHistoryMessageTip}
        onClick={this.onClickHandler}
      >
        <span>
          { this.text }
        </span>
      </div>
    ) as any
  }
})
